package com.example.administrator.xiaobo.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.Toast;

import com.example.administrator.xiaobo.R;

public class OpinionActivity extends AppCompatActivity {

    private EditText et1, et2;
    private Button btn;
    private ImageView imgback;

    private RelativeLayout re;
    private ImageView im;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Intent intent = getIntent();
        String iddata = intent.getStringExtra("id");
        if (iddata != null) {
            if (iddata.equals("opinion")) {
                setContentView(R.layout.activity_opinion);
                initopin();
            } else {

                setContentView(R.layout.activity_about);
                initabout();
            }
        }
    }

    //意见建议
    private void initopin() {
        et1 = ((EditText) findViewById(R.id.help_feedback));
        et2 = ((EditText) findViewById(R.id.help_feedback2));

    }

    //关于
    private void initabout() {

    }

    public void click(View v) {
        switch (v.getId()) {

            case R.id.btn_tj:
                final String s = et1.getText().toString();
                if (s.isEmpty()) {
                    Toast.makeText(OpinionActivity.this, "提交成功", Toast.LENGTH_SHORT).show();
                } else {
                    Toast.makeText(OpinionActivity.this, "请输入建议意见", Toast.LENGTH_SHORT).show();
                }
                break;
            case R.id.iv_back_opin:
                finish();
                break;
            case R.id.iv_back_about:
                finish();
                break;
            case R.id.relative_about:
                startActivity(new Intent(OpinionActivity.this, MianzeActivity.class));
                break;
        }
    }


}
